package protocol.common.util;

import java.util.HashMap;
import java.util.Map;

public class MapUtil {
	
	public static boolean contrast(Map<String,String> mapOne,Map<String,String> mapTwo){
		if(mapOne.size() == mapTwo.size()){
			for(String key : mapOne.keySet()){
				if(mapTwo.containsKey(key)){
					if(mapTwo.get(key).equals(mapOne.get(key))){
						continue;
					}
				}
				return false;
			}
			return true;
		}
		return false;
	}
	
	/**
	 * 生成Map
	 * @param keys keys1,keys2,keys3
	 * @param values
	 * */
	public static Map<String,Object> makeMap(String keys,Object...values){
		Map<String,Object> returnMap = new HashMap<String,Object>();
		String[] keysArray = keys.split(",");
		for(int index = 0;index<keysArray.length;index++){
			returnMap.put(keysArray[index], values[index]);
		}
		return returnMap;
	}
	
}
